package com.baiwei.vpnapi.dao;

import com.baiwei.vpnapi.entity.UserPackage;
import com.baiwei.vpnapi.entity.VpnPackage;
import com.baiwei.vpnapi.entity.respentity.AvailablePackage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @program: vpnapi
 * @description: 用户套餐Dao
 * @author: Mr. Stone
 * @create: 2020-03-03 15:09
 **/
@Mapper
public interface UserPackageMapper extends BaseMapper<UserPackage> {
    //获取当前用户生效套餐
    AvailablePackage findCurrentPakcage(@RequestParam("userId") Integer userId);
    //获取最新套餐
    AvailablePackage findLastUnusedOrInusePackage(@RequestParam("userId") Integer userId);
    //获取用户所有的套餐
    List<AvailablePackage> findHistoryPackages(@RequestParam("userId") Integer userId);
    // 获取当前用户的专线套餐
    List<AvailablePackage> findExclusivePackage(@RequestParam("userId") Integer userId);
}
